# Contributor: Frederic Wang <fred.wang@free.fr>

_realname=zope.interface
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=5.1.0
pkgrel=1
pkgdesc='Interfaces for Python (mingw-w64)'
url=' https://github.com/zopefoundation/zope.interface'
license=('ZPL 2.1')
arch=('any')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
_dtoken="ac/8a/657532df378c2cd2a1fe6b12be3b4097521570769d4852ec02c24bd3594e"
source=("${_realname}-${pkgver}.tar.gz::https://github.com/zopefoundation/zope.interface/archive/${pkgver}.tar.gz")
sha256sums=('19119247675e9c8b05234b36a5fa4a69e1232ffacc108141021acf97af70091c')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  ${MINGW_PREFIX}/bin/python setup.py build
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"

  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}"

  install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
